<%@page import="com.bill.common.system.dto.RuleDTO"%>
<%@page import="com.bill.common.system.service.IRuleService"%>
<%@page import="com.bill.common.business.service.IMatchService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>正在自动匹配</title>
</head>
<body>


<%
	ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());

	IRuleService ruleService = (IRuleService)ac.getBean("ruleService");
	RuleDTO ruleDTO = ruleService.findRuleInfo();
	Long refreshTime = ruleDTO.getTimeOut1()*1000;
	request.setAttribute("refreshTime",refreshTime);

	IMatchService matchService = (IMatchService)ac.getBean("matchService");
	String result = matchService.satrtMatchByGuPiao();
	request.setAttribute("result",result);
	
%>
<h3>每${refreshTime/1000}秒自动匹配,上次匹配时间：<fmt:formatDate value="<%=new Date() %>"  type="both" dateStyle="default"/></h3>
<p>正在匹配中......</p>
<p>${result }</p>
<script>
function myrefresh()
{
	window.location.reload();
}
setInterval("myrefresh()","${refreshTime}");
</script>



</body>
</html>